Search Results: "bzed"

13 March 2010

Bernd Zeimetz: assimilated

At the Chemnitzer Linux Tage the fedora project was assimilated by the Debian project as fedora realized that rpm is crap ;)

Bernd Zeimetz: language based rewrites with lighttpd and mod magnet

lighttpd is web server with a fast growing user base. This howto shows how redirects can be done based on the language of the user's browser. While migrating http://blog.credativ.com from Wordpress to Movable Type we decided to show the blog's welcome message in English or German depending on the language setting of the user's browser. Since one of the reasons for the switch to the new blog engine was that Movable Type creates static html pages we avoided cgi scripts or similar workarounds. As we are using Lighttpd to serve all pages, the use of the mighty mod_magnet module was obviously the way to go for this task. It allows to control the request handling within Lighttpd by running Lua scripts which are allowed to modify most aspects of the way how a request is handled. So now http://blog.credativ.com/ is rewritten to the file with the proper language by using the help of the following Lua snippet:
lighty.env["uri.path"] = "/en/index.html"
lang = lighty.request['Accept-Language']
if (lang) then
        if (string.sub(lang,1,2) == 'de') then
                lighty.env["uri.path"] = "/de/index.html"
        end
end
lighty.env["physical.rel-path"] = lighty.env["uri.path"]
lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
Of course, the Lighttpd configuration must include mod_magnet. To actually rewrite any request to "/" the configuration must also include the following snippet:
$HTTP["url"] =~ "^/$"  
    magnet.attract-physical-path-to = ( "/path/to/your/script.lua" )
 
mod_magnet caches the compiled script and executes it within the core of Lighttpd so it shouldn't introduce any noticeable delay in the delivery of your webpages.

18 February 2010

Bernd Zeimetz: merkaartor svn snapshot uploaded to experimental

As the release of version 0.15 of Merkaartor (a map editor for OpenStreetMap.org) is planned for the end of February, I've uploaded a svn snapshot based on revision 19956 to Debian experimental. Please test it and report bugs to the BTS as soon as possible, so I can triage and forward them to upstream.

17 February 2010

Stefano Zacchiroli: RC bugs of the week - issue 21

RCBW - #21 I've accumulated one more day of delay, but here is a full RCBW issue. Still, I've a nice good excuse for the extra delay: I've changed house in Paris, the new one is very small (a chambre de bonne), but also very comfortable. Without any further ado, here are this week's squashes: And here are the usual highlights:

10 February 2010

Bernd Zeimetz: BSP2010 a great success - 200 bugs eliminated

Some of the participants of the BSP here in M nchengladbach asked me to put the blog post from blog.credativ.com on planet Debian. I think thats a great idea as the BSP was not only successfull, but also a lot of fun and it was very nice to meet a lot of Debian Developers and package maintainers. We were glad that so many people followed the invitation! So here we go - please leave your comments at the original blog post.

Debian Logo
The 2010 Debian Bug Squashing Party turned out to be a great success: around 200 bugs were fixed, ready for the forthcoming version of Debian. The weekend of 22-24 January saw this year s Bug Squashing Party hosted yet again by credativ. The aim of the weekend was to find and fix bugs in the next Debian release. The results were as follows:
Work on Debian Results
Installed Patches 5
Fixed Bugs 44
Non-critical Bugs 28
Completely removed Packages 87
Packages removed from Testing 29
Altogether that gives a grand total of 200 bugs. In addition, information was gathered on a further 100 bugs, which will help when they come to be fixed. A lot of time was also spent on quality assurance, an under appreciated but very important job. More gossip: it is rumoured that backports.org is not far off becoming an official Debian project and in the meantime it will be launching a brand new website running on ikiwiki. Our guests from far and wide were more than happy with the BSP party: Steve McIntyre: (Debian project leader)
Thanks to the folks at credativ for hosting and participating in the BSP - we got a huge amount of work done towards the next release and had a great time doing it!
Stefano Zacchiroli:
My 1st M nchengladbach BSP, won t be the last! Lots of cool people and hacking, and I ve enjoyed my 1st traditional Formorer s chilli too :).
credativ would like to thank all those who came and got involved - now you can lean back, relax and enjoy the photos of the event.

Bernd Zeimetz: caching issues in django

Yesterday I stumbled upon an interesting and broken behaviour of Django: Running two instances with the same memcached as cache backend might result in displaying the wrong template from the cache in case we have template files with the same name but a different content. This behaviour is also visible in all django applications which use the cache backend without taking care of settings.CACHE_MIDDLEWARE_KEY_PREFIX. As mentioned in the bug report a design decision is necessary here, as the setting was only supposed to be used in middlewares. On the other side not honouring the setting everywhere makes it impossible to use different (unrelated) Django instances with one memcached. While this is not such a big issue for template data, it should be - for example - possible to insert faked django CMS user permissions into memcached as they are cached there, too. One possible solution is to ensure that settings.CACHE_MIDDLEWARE_KEY_PREFIX (or a similar setting with a better name) is used for every access. Using the following snippet as custom cache backend ensures this. Additionally it is much harder to insert faked cache content by using a md5 hexdigest as key. Although you should never store sensitive data in memcached - if you need to cache such data, use locmem, file or db as cache backend, as they allow to limit access to the data properly.
from django.conf import settings
from django.core.cache.backends.memcached import CacheClass as DjangoMemcachedCacheClass
from django.utils.hashcompat import md5_constructor
class CacheClass(DjangoMemcachedCacheClass):
    def __init__(self, server, params):
        self.key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
        super(CacheClass, self).__init__(server, params)
    def _genkey(self, origkey):
        return md5_constructor("%s:%s" %(self.key_prefix, origkey)).hexdigest()
    def add(self, key, value, timeout=0):
        return super(CacheClass, self).add(self._genkey(key), value, timeout)
    def get(self, key, default=None):
        return super(CacheClass, self).get(self._genkey(key), default)
    def set(self, key, value, timeout=0):
        return super(CacheClass, self).set(self._genkey(key), value, timeout)
    def delete(self, key):
        return super(CacheClass, self).delete(self._genkey(key))
    def get_many(self, keys):
        return super(CacheClass, self).get_many(self._genkey(key))
    def incr(self, key, delta=1):
        return super(CacheClass, self).incr(self._genkey(key), delta)
    def decr(self, key, delta=1):
        return super(CacheClass, self).decr(self._genkey(key), delta)

31 January 2010

Axel Beckert: abe@debian.org

On Wednesday I got DAM approval and since Saturday late evening I m officially a Debian Developer. Yay! :-) My thanks go to As Bernd cited in his AM report, my earliest activity within the Debian community I can remember was organising the Debian booth at LinuxDay.lu 2003, where I installed Debian 3.0 Woody on my Hamilton Hamstation hy (a Sun SparcStation 4 clone). I wrote my first bugreport in November 2004 (#283365), probably during the Sarge BSP in Frankfurt. And my first Debian package was wikipedia2text, starting to package it August 2005 (ITP #325417). My only earlier documented interest in the Debian community is subscribing to the lists debian-apache@l.d.o and debian-emacsen@l.d.o in June 2002. I though remember that I started playing around with Debian 2.0 Hamm, skipping 2.1 (for whatever reasons, I can t remember), using 2.2 quite regularily and started to dive into with Woody which also ran on my first ThinkPad bijou . I installed it over WLAN with just a boot floppy at the Chemnitzer Linux-Tage. :-) Anyway, this has led to what it had to lead to a new Debian Developer. :-) The first package I uploaded with my newly granted rights was a new conkeror snapshot. This version should work out of the box on Ubuntu again, so that conkeror in Ubuntu should not lag that much behind Debian Sid anymore. In other News Since Wednesday I own a Nokia N900 and use it as my primary mobile phone now. Although it s not as free as the OpenMoko (see two other recent posts by Lucas Nussbaum and by Tollef Fog Heen on Planet Debian) it s definitely what I hoped the OpenMoko will once become. And even if I can t run Debian natively on the N900 (yet), it at least has a Debian chroot on it. :-) I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting A few weeks ago, I took over the organisation of this year s Debian booth at FOSDEM from Wouter Verhelst who s busy enough with FOSDEM organisation itself. Last Monday the organiser of the BSD DevRoom at FOSDEM asked on #mirbsd for talk suggestions and they somehow talked me into giving a talk about Debian GNU/kFreeBSD. The slides should show up during the next days on my Debian GNU/kFreeBSD talks page. I hope, I ll survive that talk despite giving more or less a talk saying Jehova! . ;-) What a week.

16 January 2010

Stefano Zacchiroli: RCBW strike - BSP in Moenchengladbach

RC squashing news In the last two weeks I didn't progress as usual with RC bug squashing, even if I've some squashes to share: The reason for my under-activity are that for a week I'd relatively scarce network connectivity, which is a badly needed good for RCBW. Then, this week, I got swamped by various tasks at the university (including co-authoring a paper with Lucas, more on this (hopefully) in the future). My residual RCBW time has been devoted to write a page about RCBW where I've tried to summarize my initial motivations and the main points of the initiative, which I consider established by the first 18 weeks of activity. Starting from next week I'll be back with daily squashes. In the week-end ... drum roll ... I'll be attending the BSP in M nchengladbach, hosted by Credativ; I'll personally be kindly hosted by bzed which I thank already for that and for the BSP organization. See you there (!?)

28 November 2009

Bernd Zeimetz: the ganneff way of becoming a debian package maintainer

Once there was a project called Debian and a Ganneff.... (unfortunately in German only....)
22:20 < cb> Das ist doch voll die Arbeit Maintainer zu werden :-). Ich geb
gew nschte Pakete immer nur weiter an einen der da sowieso schon den Kernel
betreut :-)
22:21 < Ganneff> es is nur viel arbeit wenn du keinen schimmer hast
22:22 < cb> ja ich hab nur das seepferdchen *g*
22:22 < Obilan> Knusper: ja sicher ist es das
22:22 < Knusper> kopf -> tisch
22:22 < cb> Knusper, wenn du die verwaisten pakete findest siehst du auf
der gleichen seite auch die links wie man maintainer wird
22:22 < Knusper> die hab ich gefunden
22:22 < cb> zumindest hab ich das das letzte mal dort gesehen
22:24 < Ganneff> wnpp?
22:24 < Knusper> aber man brauch dann schon leute, die einen "hoffieren"
22:26 < Ganneff> du brauchst erstmal die ahnung nen paket zu bauen.
22:26 < Ganneff> dazu siehe new maint guide
22:26 < Ganneff> dann brauchste nen sponsor. dazu gehe zur mentors liste
22:26 < Ganneff> dann machste mit dem eh weng rum (also normal so
paketuploads via dem)
22:26 < Ganneff> und hast da halt schon dein maintenance krams.
22:27 < Ganneff> irgendwann is der sponsor angekotzt von dir und dem
laufenden arbeit generieren
22:27 < Ganneff> der tritt dich dann dass du mal DM anf ngst.
22:27 < Ganneff> das machste dann, und jemand anders tritt dir deine pakete
als dmua zurecht, nachdem du in nem keyring irgendwo steckst.
22:27 < Ganneff> und dann kannste denn krampf selbst hochladen. aber nix
andres.
22:27 < Ganneff> irgendwann willste was andres. und willst das auch noch
ohne son doofen sponsor
22:28 < Ganneff> dann versuchste dich an DD
22:28 < Knusper> ahhhhhh
22:28 < Ganneff> dazu musste dir nen advocate suchen
22:28 < Ganneff> der is  blicherweise einer dem du vorher im prozess
laufend auf den wecker fielst
22:28 < Ganneff> und er deswegen den nm leutz sagt "oh gott, befreit mich
bloss von dem"
22:28 < Ganneff> die machen das dann, aber sie wollen dir mal etwas
schmerzen zur ckgeben
22:28 < Ganneff> desdewegen wirste viele fragen beantworten m ssen
22:29 < Ganneff> und wie beim t v das auto musste hier deine pakete nochmal
vorstellen und checken lassen
22:29 < Ganneff> und dann nochmal fragen beantworten
22:29 < Knusper> thx...
22:29 < Ganneff> irgendwann gehst du dann mit den antworten den nm leuten
so auf den geist dass die dem frontdesk sagen "meine kacke, den wolle mehr
nit mehr sehen, schickts den dochma zu den DAMs, die hamms verdient"
22:30 < Ganneff> und die machen das dann meist. ausser sie m gen dich nich.
dann darfste nochma fragen beantworten
22:30 < Ganneff> bei den dams darfste nur warten. die testen deine geduld
22:30 < Ganneff> irgendwann langweilen die sich aber
22:30 < Ganneff> und dann kriegste pl tzlich mail
22:30 < Ganneff> OH MEIN GOTT. EIN NEUER DD.
22:30 < Ganneff> ende
22:30 < Ganneff> kapitel 2:
22:30 < cb> sch ne beschreibung
22:30 < Ganneff> du machst ne zeit als dd rum
22:30 < Knusper> LOL
22:30 < Ganneff> votest durch die gegend
22:30 < Ganneff> l dst pakete umher
22:30 < Ganneff> machst bugs in stable
22:30 < Ganneff> gibts dem security team arbeit
22:31 < Ganneff> sprich - du gehst allen auf den sack. denn das is was ein
dd macht. muss ja schliesslich auch spass machen.
22:31 < Ganneff> aber irgendwann, also irgendwann, da wird das langweilig
22:31 < Ganneff> und dann verschwindeste mal ne zeit.
22:31 < Ganneff> weil du weisst - da gibts noch son team. das brauch auch
arbeit
22:31 < Ganneff> die suchen so leute die weggehen und sich verstecken
22:31 < Ganneff> nennt sich mia. die suchen.
22:31 < Ganneff> vielleicht finden die dich ja auch.
22:32 < Ganneff> dann kommste zur ck und machst mal wieder etwas arbeit f r
security/stable/sonstwen
22:32 < Ganneff> oder nicht, aber das is langweilig, da fliegste einfach.
22:32 < Ganneff> wennde dann gar keinen bock mehr hast und ne l ngre pause
willst
22:32 < Ganneff> dann gehste und machst eien auf emeritus
22:32 < Ganneff> das sind die rentner, die alten s cke, die sich
zur cklehnen und  ber die versuche der neuen lachen die sich grad von den
sponsoren qu len lassen
22:33 < Ganneff> ende kap. 2, ich hab keinen bock mehr. (jaja, emeritus)
Cheers to #debian.de on freenode :-)

22 September 2009

Bernd Zeimetz: cupt rocks

Although I'm a really happy cupt user for several weeks now, I have to admit that I didn't read the manpage until a few minutes ago. But after being annoyed by apt-get source again, I thought that chances are good that cupt will help me. And so it was! Now there is a new alias in my zsh config:
alias tget='cupt source --tar-only'
Very useful if you work in teams which keep only the debian directory in their vcs and you need to upload a new revision of a package. Another thing that really rocks is the cupt shell. Give it a try! And don't forget to read cupt(1).

16 September 2009

Bernd Zeimetz: douf00 - fat free presentations

Now there is yet another package with a weird name in Debian - douf00 - a lightweight, slim and straight forward presentation tool. Written by some guys from a hacking and security team, which is mainly based in Vienna - guess that explains the l33t name (if you're scared now, yes, I've reviewed the code...). At the FrOSCon one of the authors asked me if I'd be willing to package it for Debian.I'm sure you'll love it if you're giving presentations and don't like to mess with Openoffice.org and friends. Below I've cited some parts of the README - make sure you read the linked file if you want to know more, or just install the package and give it a try. Douf00 is a lightweight, slim and straight forward Presentation Tool. It assists novice as well as experienced speakers when giving lectures and business meetings. With its simple presenters Screen that includes current slide - next slide (preview) as well as timers it is designed to assist those of us, that are willing to step up their lectures to the next level. The main reason why we created douf00 is because we (nice name crew) travel to conferences very often. As a matter of fact i always carried my macbook pro to every event. I always loved keynote and how the presenters screen works. Not having to worry about your beamer configuration and presenters screen is really comforting. However since i love to pack small and play big (on it stuff) i really felt we had to do something about it. Given the current situation presenters using linux have to deal with, we decided to simplify it. Of corse as a geek i would love to travel just with my netback saving valuable space in my backpack. In reality i was always caring my heavy macbook pro 15" everywhere just to lecture. Not only is it bad to give a presentation standing behind your machine because your presenters remote doesn't work. It is also highly annoying to always have to fumble around with your graphics card. Given the large verity of tools for creating your slides. (i.e.: powerpoint, open office impress, apple's keynote, latech-beamer,....) We felt there was no room for yet another slide creation tool. Nonetheless i noticed my desire to jump onstage, give a really good presentation without the usual worries. To be honest i use Keynote from apple on my home computer as i find it the most comforting tool to create slides. But now that we have created doufoo i save up on baggage space, and i finally managed to get rid of all the worries beforehand. But what is doufoo? - The perfect choice for every presenter that has more important stuff todo than care about beamer configuration more than once. Its fast, simple and lightweight. We think that caring less about your gear and focusing on the presentation itself is the best way to keep your audience enthusiastic and entertained.

28 May 2009

Michael Prokop: Debian.Developer->add_member( mika )

Since 2009-05-28 I m an official Debian Developer. Thanks to all involved people. Special thanks to Gerfried Rhonda Fuchs for being my advocate and a helpful package sponsor, to Alexander formorer Wirt for being a helpful package sponsor, to Christoph Myon Berg and Bernd bzed Zeimetz from the frontdesk and to Marc he Brockschmidt for being a great Application Manager.

24 May 2009

Bernd Zeimetz: howto set android developer device permissions with udev

As there're several, more or less well working howtos about creating udev rules to allow access to the USB debug devices of Android phones out there in the wild, I decided to write my own one. It works at least for Debian Testing/Squeeze. The udev rules file I provide here works at least for the HTC Dream models (aka T-Mobile G1 and Google Devphone). As a computer may be used by more than one user, I've decided to create a group called androiddev. Members of the group will be allowed to access the debug interface. Running (hint: become root first) addgroup --system androiddev will create the group for you. Add your developers to the group with adduser username androiddev (of course replace username with the user you'd like to add) and we're ready to configure udev. Open /etc/udev/android.rules in an editor and add the following lines:
SUBSYSTEMS=="usb", ATTRS idVendor =="0bb4", ATTRS idProduct =="0c01", MODE="0660", OWNER="root", GROUP="androiddev", SYMLINK+="android%n"
SUBSYSTEMS=="usb", ATTRS idVendor =="0bb4", ATTRS idProduct =="0c02", MODE="0660", OWNER="root", GROUP="androiddev", SYMLINK+="android%n"
Now we need to link the created rules file into /etc/udev/rules.d ln -s ../android.rules /etc/udev/rules.d/90-android.rules and tell udev to reload the rules: /etc/init.d/udev reload That's it. Don't forget to re-login to make sure your new shiny group will show up! Now have fun with adb and fastboot :) Thanks to TauPan from #debian/freenode.net who gave me the idea for this blog post.

20 April 2009

Bernd Zeimetz: package build time: cdbs vs dh

Most people (at least those who hear me shouting on irc) probably know that I'm not a fan of cdbs. While working on geoclue, which builds a lot of binary packages I realized, that cdbs wastes an insane amount of time by calling dh_* for every single package. One of the reasons geoclue uses cdbs is that the maintainer likes the short debian/rules file. We'll, compare yourself: cdbs:
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/utils.mk
common-binary-predeb-arch:: list-missing
clean::
    rm -f providers/gypsy/Makefile
    rm -rf debian/tmp
Build time: dpkg-buildpackage -B 132.20s user 41.52s system 90% cpu 3:11.13 total dh(1):
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/quilt/quilt.make
build: $(QUILT_STAMPFN) build-stamp
build-stamp:
    dh build
    touch $@
%:
    dh $@
clean: clean-patched unpatch
clean-patched:
    dh clean
    rm -f providers/gypsy/Makefile
    rm -f build-stamp
.PHONY: patch unpatch clean clean-patched build 
Build time: dpkg-buildpackage -B 85.63s user 32.91s system 91% cpu 2:08.91 total So cdbs wasted about one minute of time using a 2.4 GHz Intel Core2Duo. I'm wondering how much more time it takes on slow architectures like mips(el) and arm(el). One more argument against the unmaintaible mess of makefiles called cdbs.

19 April 2009

Bernd Zeimetz: gimp-plugin-registry updated

Somehow I managed to forget to blog about this for some time - version 2.1-1 of gimp-plugin-registry is available in testing since several days. For detailed changes please have a look in the changelog, for the impatient - here is the summary: As usual let me know if there's a nice plugin you'd like to see in the package.

13 March 2009

Bernd Zeimetz: gimp-plugin-registry update planned

Within the next days I plan to update the gimp-plugin-registry package, including the latest versions of all plugins. So if you'd like to see a new fance plugin in the package, or you have any other wish, please add a comment here, or even better, file a wishlist bug report against the package. Patches are welcome, git repository informations are listed below. Extra points if you find new/forked versions of plugins which are/were listed on registry.gimp.org but disappeared or are not updated anymore. Since the page moved to a blog-like style, and old plugin entries are not updated as before, it became harder for me keep the plugins uptodate. Help is appreciated.

24 February 2009

Bernd Zeimetz: why you should use gpsd over gypsy

While working on the Debian packages of navit I stumbled upon gypsy, as the libgypsy is used by navit to listen to notifications about location changes via D-Bus. As maintainer of the gpsd package I started to wonder what the opinion of the gpsd developers about gypsy is - especially after reading that "Gypsy was designed to fix the numerous design flaws found in GPSD". Well, here is their answer, which I support fully. I'm blogging about it as I think it is important to know about this details if you plan to do something useful with a gps device, for example on mobile phones like the OpenMoko Freerunner. gpsd works very well on embedded devices, and if there's a feature missing just contact the developers. They're very responsive and like to implement useful features, if they can get a spec to do so (and even better, the hardware to test it). So I'm really wondering if it wouldn't make sense to replace the minimal NMEA/UBX implementation in the FSO Framework Daemon by gpsd, even if that means to compile code instead of writing Python code, which is much faster for rapid prototyping, of course.

23 February 2009

Bernd Zeimetz: awesome calendar widget

One of the things I was missing in my favourite windowmanager awesome was a calendar widget. So I spent some minutes and coded it. Moving the mouse over the time widget will show a naughty popup with the current month, use your mouse buttons (and the shift key) to scroll trough the months. The only annoying thing was to figure out how to change the text of an existing notification: notification.box.widgets[2].text = "new test" is neither easy to figure out nor to use. But here's the code for your rc.lua - in case you want to have a license for it - the code is published as public domain or under the ISC license, what ever you prefer.
function displayMonth(month,year,weekStart)
    local t,wkSt=os.time year=year, month=month+1, day=0 ,weekStart or 1
    local d=os.date("*t",t)
    local mthDays,stDay=d.day,(d.wday-d.day-wkSt+1)%7
    local lines =  
    for x=0,6 do
        lines[x+1] = os.date("%a ",os.time year=2006,month=1,day=x+wkSt )
    end
    lines[8] = "    "
    local writeLine = 1
    while writeLine < (stDay + 1) do
        lines[writeLine] = lines[writeLine] .. "   "
        writeLine = writeLine + 1
    end
    for x=1,mthDays do
        if writeLine == 8 then
            writeLine = 1
        end
        if writeLine == 1 or x == 1 then
            lines[8] = lines[8] .. os.date(" %V",os.time year=year,month=month,day=x )
        end
        if (#(tostring(x)) == 1) then
            x = " " .. x
        end
        lines[writeLine] = lines[writeLine] .. " " .. x
        writeLine = writeLine + 1
    end
    local header = os.date("%B %Y\n",os.time year=year,month=month,day=1 )
    header = string.rep(" ", math.floor((#(lines[1]) - #header) / 2 )) .. header
    return header .. table.concat(lines, '\n')
end
local calendar =  
function switchNaughtyMonth(switchMonths)
    if (#calendar < 3) then return end
    local swMonths = switchMonths or 1
    calendar[1] = calendar[1] + swMonths
    calendar[3].box.widgets[2].text = displayMonth(calendar[1], calendar[2], 2)
end
mytextbox.mouse_enter = function ()
    local month, year = os.date('%m'), os.date('%Y')
    calendar =   month, year, 
                naughty.notify( 
                    text = displayMonth(month, year, 2),
                    timeout = 0, hover_timeout = 0.5,
                    width = 200
                 )
                
end 
mytextbox.mouse_leave = function () naughty.destroy(calendar[3]) end
mytextbox:buttons( 
    button(   , 1, function()
        switchNaughtyMonth(-1)
    end),
    button(   , 3, function()
        switchNaughtyMonth(1)
    end),
    button(   , 4, function()
        switchNaughtyMonth(-1)
    end),
    button(   , 5, function()
        switchNaughtyMonth(1)
    end),
    button(  'Shift'  , 1, function()
        switchNaughtyMonth(-12)
    end),
    button(  'Shift'  , 3, function()
        switchNaughtyMonth(12)
    end),
    button(  'Shift'  , 4, function()
        switchNaughtyMonth(-12)
    end),
    button(  'Shift'  , 5, function()
        switchNaughtyMonth(12)
    end)
 )

Bernd Zeimetz: awesome calendar widget

One of the things I was missing in my favourite windowmanager awesome was a calendar widget. So I spent some minutes and coded it. Moving the mouse over the time widget will show a naughty popup with the current month, use your mouse buttons (and the shift key) to scroll trough the months. The only annoying thing was to figure out how to change the text of an existing notification: notification.box.widgets[2].text = "new test" is neither easy to figure out nor to use. But here's the code for your rc.lua - in case you want to have a license for it - the code is published as public domain or under the ISC license, what ever you prefer. Update: With thanks to a hint from madduck, the naughty popup is now aware of the screen your mouse is pointing to.
function displayMonth(month,year,weekStart)
    local t,wkSt=os.time year=year, month=month+1, day=0 ,weekStart or 1
    local d=os.date("*t",t)
    local mthDays,stDay=d.day,(d.wday-d.day-wkSt+1)%7
    local lines =  
    for x=0,6 do
        lines[x+1] = os.date("%a ",os.time year=2006,month=1,day=x+wkSt )
    end
    lines[8] = "    "
    local writeLine = 1
    while writeLine < (stDay + 1) do
        lines[writeLine] = lines[writeLine] .. "   "
        writeLine = writeLine + 1
    end
    for x=1,mthDays do
        if writeLine == 8 then
            writeLine = 1
        end
        if writeLine == 1 or x == 1 then
            lines[8] = lines[8] .. os.date(" %V",os.time year=year,month=month,day=x )
        end
        if (#(tostring(x)) == 1) then
            x = " " .. x
        end
        lines[writeLine] = lines[writeLine] .. " " .. x
        writeLine = writeLine + 1
    end
    local header = os.date("%B %Y\n",os.time year=year,month=month,day=1 )
    header = string.rep(" ", math.floor((#(lines[1]) - #header) / 2 )) .. header
    return header .. table.concat(lines, '\n')
end
local calendar =  
function switchNaughtyMonth(switchMonths)
    if (#calendar < 3) then return end
    local swMonths = switchMonths or 1
    calendar[1] = calendar[1] + swMonths
    calendar[3].box.widgets[2].text = displayMonth(calendar[1], calendar[2], 2)
end
mytextbox.mouse_enter = function ()
    local month, year = os.date('%m'), os.date('%Y')
    calendar =   month, year, 
                naughty.notify( 
                    text = displayMonth(month, year, 2),
                    timeout = 0, hover_timeout = 0.5,
                    width = 200, screen = mouse.screen
                 )
                
end 
mytextbox.mouse_leave = function () naughty.destroy(calendar[3]) end
mytextbox:buttons( 
    button(   , 1, function()
        switchNaughtyMonth(-1)
    end),
    button(   , 3, function()
        switchNaughtyMonth(1)
    end),
    button(   , 4, function()
        switchNaughtyMonth(-1)
    end),
    button(   , 5, function()
        switchNaughtyMonth(1)
    end),
    button(  'Shift'  , 1, function()
        switchNaughtyMonth(-12)
    end),
    button(  'Shift'  , 3, function()
        switchNaughtyMonth(12)
    end),
    button(  'Shift'  , 4, function()
        switchNaughtyMonth(-12)
    end),
    button(  'Shift'  , 5, function()
        switchNaughtyMonth(12)
    end)
 )

15 February 2009

Bernd Zeimetz: migrating to ikiwiki

Hi Planet Debian! After being away from the planet for more than a year now, I'm finally back :) My plan to migrate to ikiwiki got postponed a lot of times as I had more important things to do. The migration of the content of my old wiki is still not complete, but I hope to finish that soon. Why I've migrated away from Dokuwiki? Mainly because I really prefer to have a git backend and being able to add content with vim. The other reason is that php sucks. Dokuwiki really rocks otherwise, and I'll keep recommending it to the not-so-geekish people. Be prepared to see more posts from me soon :) In the meantime it would be great if you'd tell me if therere CSS problems somewhere, I've tested it with Iceweasel only. Thanks in advance!

Next.

Previous.